package com.alibaba.citrus.cr.sales.plan.facade.service.setting;

import com.alibaba.citrus.cr.common.annotation.FacadeInvoker;
import com.alibaba.citrus.cr.sales.plan.api.setting.SendHistoryRecordQueryService;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.PageQuerySendHistoryRequest;
import com.alibaba.citrus.cr.sales.plan.repository.SendHistoryRecordRepository;
import com.alibaba.citrus.cr.sales.plan.sdo.SendHistoryRecordSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.sdk.model.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SendHistoryRecordQueryServiceImpl implements SendHistoryRecordQueryService {

    @Resource
    private SendHistoryRecordRepository sendHistoryRecordRepository;

    @FacadeInvoker
    @Override
    public Result<PageResult<List<SendHistoryRecordSDO>>> pageQuerySendHistoryRecord(PageQuerySendHistoryRequest pageQuerySendHistoryRequest) {
        PageResult<List<SendHistoryRecordSDO>> listPageResult = sendHistoryRecordRepository.pageQuery(pageQuerySendHistoryRequest);
        return Result.success(listPageResult);
    }

}
